package com.matrix.geo.playmysqlgeo.controller;

import com.github.pagehelper.PageInfo;
import com.matrix.geo.playmysqlgeo.domain.po.ObjectPointPO;
import com.matrix.geo.playmysqlgeo.service.HelloService;
import com.matrix.geo.playmysqlgeo.service.ObjectPointService;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.Point;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@RestController
@RequestMapping("/objectPoint")
public class ObjectPointController {

    private final ObjectPointService objectPointService;

    @Autowired
    public ObjectPointController(
            ObjectPointService objectPointService
    ) {
        this.objectPointService = objectPointService;
    }

    @PostMapping("/commonConvert")
    public Mono<Geometry> convert(@RequestBody Geometry geometry){
        return Mono.just(geometry);
    }

    @PostMapping("/convert")
    public Mono<Point> convert(@RequestBody Point point){
        return Mono.just(point);
    }

    @PostMapping("/query")
    public Mono<PageInfo<ObjectPointPO>> query(@RequestBody Point point){
        return Mono.just(new PageInfo<>());
    }

}
